import Layout from "../layout/Index.vue";
import RouteView from "../components/RouteView.vue";
import OrderRouter from './modules/Order'
import Customer from './modules/Customer'
import StoreManage from './modules/StoreManage'
import FactoryManage from './modules/FactoryManage'
import Settings from './modules/Settings'
import GoodsManage from './modules/GoodsManage'

const layoutMap = [
    {
        path: "",
        name: "Index",
        meta: { title: "控制台", icon: "el-icon-s-home" },
        component: () => import("../views/Index.vue")
    },
    GoodsManage,
    OrderRouter,
    Customer,
    StoreManage,
    FactoryManage,
    Settings,
    // {
    //     path: "data",
    //     name: "Data",
    //     component: RouteView,
    //     meta: { title: "数据管理", icon: "el-icon-s-help" },
    //     children: [
    //         {
    //             path: "",
    //             name: "DataList",
    //             meta: { title: "数据列表" },
    //             component: () => import("../views/data/List.vue")
    //         },
    //         {
    //             path: "table",
    //             name: "DataTable",
    //             meta: { title: "数据表格", roles: ["admin"] },
    //             component: () => import("../views/data/Table.vue")
    //         }
    //     ]
    // },
    // {
    //     path: "admin",
    //     name: "Admin",
    //     meta: { title: "用户管理", icon: "el-icon-s-tools", roles: ["admin"] },
    //     component: RouteView,
    //     children: [
    //         {
    //             path: "",
    //             name: "AdminAuth",
    //             meta: { title: "用户列表" },
    //             component: () => import("../views/admin/AuthList.vue")
    //         },
    //         {
    //             path: "role",
    //             name: "AdminRole",
    //             meta: { title: "角色列表" },
    //             component: () => import("../views/admin/RoleList.vue")
    //         }
    //     ]
    // },
    // {
    //     path: "player",
    //     name: "Player",
    //     meta: { title: "视频播放", icon: "el-icon-video-camera-solid" },
    //     component: () => import("../views/common/XGPlayer.vue")
    // },
    // {
    //     path: "editor",
    //     name: "Editor",
    //     meta: { title: "富文本编辑器", icon: "el-icon-s-comment" },
    //     component: () => import("../views/common/Editor.vue")
    // },
    {
        path: "user",
        name: "User",
        hidden: true /* 不在侧边导航展示 */,
        meta: { title: "个人中心" },
        component: () => import("../views/admin/User.vue")
    },
    {
        path: "/error",
        name: "NotFound",
        hidden: true,
        meta: { title: "404" },
        component: () => import("../components/NotFound.vue")
    },
    {
        path: "/:w+",
        hidden: true,
        redirect: { name: "NotFound" }
    }
];

const routes = [
    { path: "/login", name: "Login", meta: { title: "登录" }, component: () => import("../views/login/Login.vue") },
    {
      path: "/",
      name: "Layout",
      component: Layout,
      children: [...layoutMap]
    }
];

export { routes, layoutMap };
